package com.msmall.erp.administer.manager.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.msmall.erp.administer.manager.AdministerManager;
import com.msmall.erp.administer.mapper.AdministerMapper;
import com.msmall.erp.administer.po.Administer;

@Service("administerManager")
public class AdministerManagerImpl implements AdministerManager {

	@Autowired
	private AdministerMapper administerMapper;

	/**
	 * @Autowired public void setAdministerMapper(@Qualifier("administerMapper")
	 *            AdministerMapper administerMapper) { this.administerMapper =
	 *            administerMapper; }
	 */

	public Administer getAdminister(String username) {
		Administer administer = administerMapper.selectAdministerByUsername(username);
		return administer;
	}

	public Administer getAdminister(Integer id) throws Exception{
		Administer administer = administerMapper.selectAdministerByid(id);
		return administer;
	}

	public Administer saveAdminister(Administer administer) throws Exception{
		administer = administerMapper.insertAdminister(administer);
		return administer;
	}
}
